//导航组件，给子组件自己压栈：pageStack


<template>

  <v-ons-navigator id="app" swipeable 
    :page-stack="pageStack" 
    @prepush="prepushLishener"
    @postpop="postpopLishener"
    >

   
    <component v-for="page in pageStack"

      
      :page-stack="pageStack"
      :is="page"
      :key="page.name"
    >

    </component>

  </v-ons-navigator>
</template>

<script>
import AppPage from './AppPage.vue';

export default {
  name: 'app',
  data() {
    return {
      pageStack: [AppPage],
      
    };
  },
  methods: {
    prepushLishener() {
        console.log("哎呀，进去了");
    },
    postpopLishener(){
        console.log("额，出来了");
    }
  }
};
</script>